<template>
	<view v-if="isVerify" class="not-open">
		该功能暂未开通
	</view>
	<view v-else>
		<view class="main-box">
			<view>
			
				
				<image id="form-box" mode="widthFix" class="bg-image" :src="imagePath+'t.png'"></image>
	<view class="times" >
					<youku-tcq2-full-roll-left-mobile></youku-tcq2-full-roll-left-mobile>
				</view>
				<view class="main-form-box">

					<youku-newtcq-v2 :mobile="formData.mobile" :param="formData.param" :submit="formData.submit"
						:baseImagePath="imagePath" :btnImg="imagePath + 'btn.png'"></youku-newtcq-v2>
				
				</view>

			</view>
		

		</view>

	<image :src="imagePath + 'b.png'" mode="widthFix" style="width: 100%;margin-top: -2rpx;"></image>

	</view>
</template>

<script>
	import httpUtil from "@/utils/httpUtil";
	import commonApi from "@/api/commonApi";
	import messageUtil from "@/utils/messageUtil.js"
	import logApi from "@/api/logApi";
	import userApi from "../../api/userApi";
	import paramApi from "../../api/paramApi";
import zfbUrlUtil from "@/utils/zfbUrlUtil";

	export default {
		data() {1
			return {
				isVerify: false,
				scrollTop: 0,
				imagePath: 'https://web.78keji.cn/images/newyus/',
				scrollToTargetId: "form-box",
				formData: {
					mobile: '',
					param: '',
					submit: 0,
					intervalId: '',
				}
			}
		},
		onLoad(option) {
			this.initData(option)
			my.hideBackHome()
			
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
		},
		onUnload(){
	
		},
		  onBackPress(e) {
		    console.log('e', e)
			if(uni.getStorageSync('mobile')){
				let url = zfbUrlUtil.wrapUrl('https://web.78keji.cn/fcs_leave/?mobile='+uni.getStorageSync('mobile')+'&uuid='+uni.getStorageSync('uuid'))
				my.ap.openURL({
					url:url ,
					success: (resx) => {
						console.log('openURL success', resx)
					},
					fail: (errx) => {
						console.log('openURL success', errx)
					}
				})
			}
		
		  },

		methods: {
			
			uuid() {
				var s = [];
				var hexDigits = "0123456789abcdef";
				for (var i = 0; i < 36; i++) {
					s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
				}
				s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
				s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
				s[8] = s[13] = s[18] = s[23] = "-";

				var uuid = s.join("");
				uni.setStorageSync('uuid', uuid)
				return uuid;
			},
			initData(option) {
				// option.a = "123aaa"
				// option.param = "11"

				logApi.addYouKuLog('youku_ljj2_full option:' + JSON.stringify(option))
				paramApi.initData(option)

				commonApi.is404()
				if (!userApi.getUserId()) {
					userApi.initUserId()
				}

				if (option.submit) {
					this.formData.submit = option.submit
				}

				commonApi.isVerify(res => {
					this.isVerify = res
				})

				commonApi.buriedPoint(63)

				let paramx = {
					a: httpUtil.getA(),
					proCode: 'LH2506',
					uuid: this.uuid()
				}
				httpUtil.post('/api/tongji/tongji0520', paramx, res => {

				})

				// 下面这个不需要调用，因为阳兄写了一个
				// userApi.initUserId()
			},
		}
	}
</script>

<style lang="scss">

	.not-open {
		height: 100vh;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #000;
	}

	.main-box {
		background-color: #66c2f5;
		
		
	}

	.main-form-box {
		width: 90%;
		
		margin: 10rpx auto 0;
	}

	.mobile-roll-left-box {
		margin-top: 10rpx;
	}

	.bg-image {
		width: 100%;
		height: auto;
	}

	.tip-text {
		letter-spacing: 2rpx;
		font-size: 20rpx;
		color: black;
		text-align: center;
		margin-top: 16rpx;
	}
</style>